import request from "@/request/request.js";

// 公共
const common = {
  /*
	  登录
	  admin_account					账号
	  admin_password				密码
	*/
  login(data) {
    return request({
      url: "/api/login/adminLogin",
      method: "post",
      data,
    });
  },
  ocr(data) {
    return request({
      url: "/api/common/ocr",
      method: "post",
      data,
    });
  },
  // 调取高德地址逆编译
  getAddress(data) {
    return request({
      url: "/api/common/getAreaInfo",
      method: "post",
      data,
    });
  },
  /*
	  省市区三级联动
	  parent_id			省份ID，如果不传，那么就返回全部的省
	*/
  getAreaList(data) {
    return request({
      url: "/api/common/getAreaList",
      method: "post",
      data,
    });
  },
  /*
	  获取登录账户信息
	*/
  getAdminUserInfoByToken(data) {
    return request({
      url: "/api/admin/getAdminUserInfoByToken",
      method: "post",
      data,
    });
  },
  /**
   *
   * 获取首页数据
   */
  getHomeDataApi(data) {
    return request({
      url: "/api/admin/getHomeList",
      method: "post",
      data,
    });
  },
  /**
   *
   * 修改密码
   */
  adminPassWordEdit(data) {
    return request({
      url: "/api/admin/adminPassWordEdit",
      method: "post",
      data,
    });
  },
  /**
   *
   * 获取二维码
   */
  sendSmsApi(data) {
    return request({
      url: "/api/common/sendSms",
      method: "post",
      data,
    });
  },
};
// 用户管理
const config = {
  /*
	用户列表
	page				页数
	size				每页显示条数
	search				模糊搜索
	*/
  getBrandInfo(data) {
    return request({
      url: "/api/brand/getBrandInfo",
      method: "post",
      data,
    });
  },
  brandInfoSave(data) {
    return request({
      url: "/api/brand/brandInfoSave",
      method: "post",
      data,
    });
  },
};
// 用户管理
const user = {
  /*
	用户列表
	page				页数
	size				每页显示条数
	search				模糊搜索
	*/
  getList(data) {
    return request({
      url: "/api/admin/getIndexUserList",
      method: "post",
      data,
    });
  },
  getUserDetail(data) {
    return request({
      url: "/api/admin/getIndexUserInfo",
      method: "post",
      data,
    });
  },
  userRadarScoresInfoSave(data) {
    return request({
      url: "/api/admin/userRadarScoresInfoSave",
      method: "post",
      data,
    });
  },
  userInfoEdit(data) {
    return request({
      url: "/api/index/userInfoEdit",
      method: "post",
      data,
    });
  },
  userInfoEdit(data) {
    return request({
      url: "/api/index/userInfoEdit",
      method: "post",
      data,
    });
  },
  getUserDetail(data) {
    return request({
      url: "/api/admin/getIndexUserInfo",
      method: "post",
      data,
    });
  },
};

const admin = {
  /*
	获取管理员列表
	page						分页数
	size						每页数
	*/
  getAdminUserList(data) {
    return request({
      url: "/api/admin/getAdminList",
      method: "post",
      data,
    });
  },
  
   adminResetPassword(data) {
    return request({
      url: "/api/admin/adminPasswordRemake",
      method: "post",
      data,
    });
  },
  adminChangePassword(data) {
    return request({
      url: "/api/admin/adminUserPasswordEdit",
      method: "post",
      data,
    });
  },
  /*
	添加管理员
    admin_username			名称
    admin_account			账号
    admin_password			密码
    admin_gender			性别
    role_id					身份ID
    district_id				城市ID
	*/
  adminInfoCreate(data) {
    return request({
      url: "/api/admin/adminInfoCreate",
      method: "post",
      data,
    });
  },
  /*
	修改管理员信息
	admin_id				管理员ID
    admin_username			名称
    admin_account			账号
    admin_password			密码
    admin_gender			性别
    role_id					身份ID
    district_id				城市ID
	*/
  adminInfoUpdate(data) {
    return request({
      url: "/api/admin/adminInfoUpdate",
      method: "post",
      data,
    });
  },
  /*
	删除管理员
	admin_id				管理员ID
	*/
  adminInfoDelete(data) {
    return request({
      url: "/api/admin/adminInfoDelete",
      method: "post",
      data,
    });
  },
  /*
	管理员账号解封/封禁
	admin_id						管理员ID
	is_banned						是否封禁 1是2否
	*/
  adminIsBannedEdit(data) {
    return request({
      url: "/api/admin/adminIsBannedEdit",
      method: "post",
      data,
    });
  },
  /*
	获取角色列表
	page						分页数
	size						每页数
	*/
  getRoleList(data) {
    return request({
      url: "/api/admin/getRoleList",
      method: "post",
      data,
    });
  },
  /*
	权限列表
	*/
  getMenuListByTreeList(data) {
    return request({
      url: "/api/admin/getMenuListByTreeList",
      method: "post",
      data,
    });
  },
  /*
	角色添加
	role_name						角色名称
	*/
  roleInfoCreate(data) {
    return request({
      url: "/api/admin/roleInfoCreate",
      method: "post",
      data,
    });
  },
  /*
	角色修改
	role_name						角色名称
	role_id							角色ID
	*/
  roleInfoEdit(data) {
    return request({
      url: "/api/admin/roleInfoEdit",
      method: "post",
      data,
    });
  },
  /*
	角色删除
	role_id							角色ID
	*/
  roleInfoDelete(data) {
    return request({
      url: "/api/admin/roleInfoDelete",
      method: "post",
      data,
    });
  },
  /*
	编辑角色权限
	role_id							角色ID
	menu_list						权限组
	*/
  roleDistributeMenu(data) {
    return request({
      url: "/api/admin/roleDistributeMenu",
      method: "post",
      data,
    });
  },
};

const teacher = {
  getList(data) {
    return request({
      url: "/api/teacher/getTeacherList",
      method: "post",
      data,
    });
  },
  update(data) {
    return request({
      url: "/api/teacher/teacherInfoUpdated",
      method: "post",
      data,
    });
  },
  create(data) {
    return request({
      url: "/api/teacher/teacherInfoCreated",
      method: "post",
      data,
    });
  },
  teacherDeactivate(data) {
    return request({
      url: "/api/teacher/teacherDeactivate",
      method: "post",
      data,
    });
  },
};
const jifengood = {
  getList(data) {
    return request({
      url: "/api/integral/getIntegralGoodsList",
      method: "post",
      data,
    });
  },
  update(data) {
    return request({
      url: "/api/integral/integralGoodsInfoUpdate",
      method: "post",
      data,
    });
  },
  create(data) {
    return request({
      url: "/api/integral/integralGoodsInfoCreate",
      method: "post",
      data,
    });
  },
  del(data) {
    return request({
      url: "/api/integral/integralGoodsInfoDelete",
      method: "post",
      data,
    });
  },

  orderList(data) {
    return request({
      url: "/api/order/adminGetGoodsOrderList",
      method: "post",
      data,
    });
  },
  integralOrderSave(data) {
    return request({
      url: "/api/order/adminGoodsOrderDelivery",
      method: "post",
      data,
    });
  },
  refundReject(data) {
    return request({
      url: "/api/order/goodsOrderRefundAudit",
      method: "post",
      data,
    });
  },
};
const tag = {
  getList(data) {
    return request({
      url: "/api/system/getTagList",
      method: "post",
      data,
    });
  },
  update(data) {
    return request({
      url: "/api/system/tagInfoUpdate",
      method: "post",
      data,
    });
  },
  create(data) {
    return request({
      url: "/api/system/tagInfoCreate",
      method: "post",
      data,
    });
  },
  del(data) {
    return request({
      url: "/api/system/tagInfoDelete",
      method: "post",
      data,
    });
  },
};
const classi = {
  getList(data) {
    return request({
      url: "/api/system/getGradeList",
      method: "post",
      data,
    });
  },
  update(data) {
    return request({
      url: "/api/system/gradeInfoUpdate",
      method: "post",
      data,
    });
  },
  create(data) {
    return request({
      url: "/api/system/gradeInfoCreate",
      method: "post",
      data,
    });
  },
  del(data) {
    return request({
      url: "/api/system/gradeInfoDelete",
      method: "post",
      data,
    });
  },
};

const typeA = {
  getList(data) {
    return request({
      url: "/api/course/getCourseCateList",
      method: "post",
      data,
    });
  },
  update(data) {
    return request({
      url: "/api/course/courseCateInfoUpdate",
      method: "post",
      data,
    });
  },
  create(data) {
    return request({
      url: "/api/course/courseCateInfoCreate",
      method: "post",
      data,
    });
  },
  del(data) {
    return request({
      url: "/api/course/courseCateInfoDelete",
      method: "post",
      data,
    });
  },
};

const classaa = {
  getList(data) {
    return request({
      url: "/api/activity/getActivityCategoryList",
      method: "post",
      data,
    });
  },
  update(data) {
    return request({
      url: "/api/activity/activityCateInfoUpdate",
      method: "post",
      data,
    });
  },
   updates(data) {
    return request({
      url: "/api/activity/activityCategoryIsShowSave",
      method: "post",
      data,
    });
  },
  create(data) {
    return request({
      url: "/api/activity/activityCateInfoCreate",
      method: "post",
      data,
    });
  },
  del(data) {
    return request({
      url: "/api/activity/activityInfoDelete",
      method: "post",
      data,
    });
  },
};

const jiaoan = {
  getList(data) {
    return request({
      url: "/api/course/courseLessonPlansInfoListByCourseId",
      method: "post",
      data,
    });
  },
  update(data) {
    return request({
      url: "/api/course/courseLessonPlansInfoUpdate",
      method: "post",
      data,
    });
  },
  
  create(data) {
    return request({
      url: "/api/course/courseLessonPlansInfoCreate",
      method: "post",
      data,
    });
  },
  del(data) {
    return request({
      url: "/api/course/courseLessonPlansInfoDelete ",
      method: "post",
      data,
    });
  },
  userlist(data) {
    return request({
      url: "/api/course/getCourseOrderList",
      method: "post",
      data,
    });
  },
};
const xiti = {
  getList(data) {
    return request({
      url: "/api/course/getQuestionsList",
      method: "post",
      data,
    });
  },
  update(data) {
    return request({
      url: "/api/course/questionsInfoUpdate",
      method: "post",
      data,
    });
  },
  create(data) {
    return request({
      url: "/api/course/questionsInfoCreate",
      method: "post",
      data,
    });
  },
};
const renwu = {
  getList(data) {
    return request({
      // url: "/api/course/courseTaskList",
      url: "/api/course/getCourseTaskListByTaskId",
      method: "post",
      data,
    });
  },
  update(data) {
    return request({
      url: "/api/course/courseTaskInfoUpdate",
      method: "post",
      data,
    });
  },
  create(data) {
    return request({
      url: "/api/course/courseTaskInfoCreate",
      method: "post",
      data,
    });
  },
  del(data) {
    return request({
      url: "/api/course/courseTaskInfoDelete",
      method: "post",
      data,
    });
  },
};
const banner = {
  getList(data) {
    return request({
      url: "/api/banner/getBannerList",
      method: "post",
      data,
    });
  },
  update(data) {
    return request({
      url: "/api/banner/bannerInfoUpdate",
      method: "post",
      data,
    });
  },
   updates(data) {
    return request({
      url: "/api/banner/bannerInfoStatusSave",
      method: "post",
      data,
    });
  },
  create(data) {
    return request({
      url: "/api/banner/bannerInfoCreate",
      method: "post",
      data,
    });
  },
  del(data) {
    return request({
      url: "/api/banner/bannerInfoDelete",
      method: "post",
      data,
    });
  },
};


const goodscaclass = {
  getList(data) {
    return request({
      url: "/api/goods/getGoodsCateList",
      method: "post",
      data,
    });
  },
  update(data) {
    return request({
      url: "/api/goods/goodsCateInfoUpdate",
      method: "post",
      data,
    });
  },
   updates(data) {
    return request({
      url: "/api/activity/activityCategoryIsShowSave",
      method: "post",
      data,
    });
  },
  create(data) {
    return request({
      url: "/api/goods/goodsCateInfoCreate",
      method: "post",
      data,
    });
  },
  del(data) {
    return request({
      url: "/api/goods/goodsCateInfoDelete",
      method: "post",
      data,
    });
  },
};


const activityjifengood = {
  orderList(data) {
    return request({
      url: "/api/order/adminGetActivityOrderList",
      method: "post",
      data,
    });
  },
  update(data) {
    return request({
      url: "/api/goods/goodsCateInfoUpdate",
      method: "post",
      data,
    });
  },
   updates(data) {
    return request({
      url: "/api/activity/activityCategoryIsShowSave",
      method: "post",
      data,
    });
  },
  create(data) {
    return request({
      url: "/api/goods/goodsCateInfoCreate",
      method: "post",
      data,
    });
  },
  del(data) {
    return request({
      url: "/api/goods/goodsCateInfoDelete",
      method: "post",
      data,
    });
  },
  rejectRefund(data) {
    return request({
      url: "/api/order/activityOrderRefundAudit",
      method: "post",
      data,
    });
  },
};


const spjifengood = {
  getList(data) {
    return request({
      url: "/api/integral/getIntegralGoodsList",
      method: "post",
      data,
    });
  },
  update(data) {
    return request({
      url: "/api/integral/integralGoodsInfoUpdate",
      method: "post",
      data,
    });
  },
  updates(data) {
    return request({
      url: "/api/goods/goodsInfoUpdate",
      method: "post",
      data,
    });
  },
  creates(data) {
    return request({
      url: "/api/goods/goodsInfoCreate",
      method: "post",
      data,
    });
  },
  
  ckxq(data) {
    return request({
      url: "/api/goods/getGoodsDetail",
      method: "post",
      data,
    });
  },
  del(data) {
    return request({
      url: "/api/integral/integralGoodsInfoDelete",
      method: "post",
      data,
    });
  },

  orderList(data) {
    return request({
      url: "/api/goods/getGoodsList",
      method: "post",
      data,
    });
  },
  updateStatus(data) {
    return request({
      url: "/api/goods/goodsInfoIsUp",
      method: "post",
      data,
    });
  },
};

const aboutUs = {
  getDetail(data) {
    return request({
      url: "/api/system/adminGetSystemConfigInfo",
      method: "post",
      data,
    });
  },
  update(data) {
    return request({
      url: "/api/system/adminUpdateSystemConfigInfo",
      method: "post",
      data,
    });
  }
};

const tsfklb = {
  orderList(data) {
    return request({
      url: "/api/system/getComplaintFeedbackList",
      method: "post",
      data,
    });
  },
  update(data) {
    return request({
      url: "/api/system/adminUpdateSystemConfigInfo",
      method: "post",
      data,
    });
  }
};

const getrokist = {
  getList(data) {
    return request({
      url: "/api/admin/getRoleList",
      method: "post",
      data,
    });
  },
  del(data) {
    return request({
      url: "/api/admin/roleInfoDelete",
      method: "post",
      data,
    });
  },
  getPermissions(data) {
    return request({
      url: "/api/admin/getRoleMenuList",
      method: "post",
      data,
    });
  },
  
  getMenuListByTreeList(data) {
    return request({
      url: "/api/admin/getMenuListByTreeList",
      method: "post",
      data,
    });
  },
  update(data) {
    return request({
      url: "/api/admin/roleInfoUpdate",
      method: "post",
      data,
    });
  },
  create(data) {
    return request({
      url: "/api/admin/roleInfoCreate",
      method: "post",
      data,
    });
  },
  setPermissions(data) {
    return request({
      url: "/api/admin/roleDistributeMenu",
      method: "post",
      data,
    });
  },
  
};


const activityspjifen = {
  orderList(data) {
    return request({
      url: "/api/activity/getActivityList",
      method: "post",
      data,
    });
  },
  getDistricts(data) {
    return request({
      url: "/api/common/getAreaList",
      method: "post",
      data,
    });
  },
  updateActivity(data) {
    return request({
      url: "/api/activity/activityInfoUpdate",
      method: "post",
      data,
    });
  },
  createActivity(data) {
    return request({
      url: "/api/activity/activityInfoCreate",
      method: "post",
      data,
    });
  },
  getActivityDetail(data) {
    return request({
      url: "/api/activity/getActivityDetail",
      method: "post",
      data,
    });
  },
  
  getList(data) {
    return request({
      url: "/api/activity/getActivityCategoryList",
      method: "post",
      data,
    });
  },
  auditActivity(data) {
    return request({
      url: "/api/activity/activityAuditSave",
      method: "post",
      data,
    });
  },
  update(data) {
    return request({
      url: "/api/integral/integralGoodsInfoUpdate",
      method: "post",
      data,
    });
  },
  updates(data) {
    return request({
      url: "/api/goods/goodsInfoUpdate",
      method: "post",
      data,
    });
  },
  creates(data) {
    return request({
      url: "/api/goods/goodsInfoCreate",
      method: "post",
      data,
    });
  },
  
  ckxq(data) {
    return request({
      url: "/api/goods/getGoodsDetail",
      method: "post",
      data,
    });
  },
  del(data) {
    return request({
      url: "/api/integral/integralGoodsInfoDelete",
      method: "post",
      data,
    });
  },
  updateStatus(data) {
    return request({
      url: "/api/goods/goodsInfoIsUp",
      method: "post",
      data,
    });
  },
};


export default {
  common,
  admin,
  user,
  // ===
  jifengood,
  classaa,
  goodscaclass,
  tag,
  typeA,
  teacher,
  jiaoan,
  renwu,
  xiti,
  banner,
  config,
  classi,
  activityjifengood,
  spjifengood,
  aboutUs,
  tsfklb,
  getrokist,
  activityspjifen
};
